	$(function(){
        //按钮单击时执行
        $("#home_bot_edit_do").click(function(){
			toastr.options = {
			  "closeButton": true,
			  "debug": false,
			  "progressBar": true,
			  "positionClass": "toast-bottom-full-width",
			  "onclick": null,
			  "showDuration": "400",
			  "hideDuration": "1000",
			  "timeOut": "7000",
			  "extendedTimeOut": "1000",
			  "showEasing": "swing",
			  "hideEasing": "linear",
			  "showMethod": "fadeIn",
			  "hideMethod": "fadeOut"
			}
			//输入验证
            if($("#bot_name").val() == ""){  
                toastr.warning("机器人名不能为空！");  
                $("#bot_name").focus();  
                return false;  
            }  
			var bot_id = $('#bot_id').val();
			var bot_name = $('#bot_name').val();
			var bot_server_id = $('#bot_server_id option:selected').val();
            //Ajax调用处理
            var home_bot_edit_do = $.ajax({
               type: "POST",
               url: "index.php?m=bot&c=bot_home&a=home_bot_edit_do",
               data: "bot_id="+bot_id+"&bot_name="+bot_name+"&bot_server_id="+bot_server_id,
               async: false
            }).responseText;
			if (home_bot_edit_do == "1") {
				toastr.success("抱歉：修改信息未成功，请重新尝试！");
			} else if (home_bot_edit_do == "2") {
				toastr.success("恭喜您：机器人"+bot_name+" ，修改成功！");
			} else {
				toastr.error("请勿提交非法数据！");
			}
         });		 
    });